package fhq.hcmute.edu.vn.network;

import java.io.Serializable;

import fhq.hcmute.edu.vn.util.ProjectUtil;

public class ComputerInfos implements Serializable {

	private static final long serialVersionUID = -7724213412920698059L;
	private String hostname;
	private String ipAddress;
	private int port;
	private String password;

	public ComputerInfos(final String hostname, final String ipAddress,
			final int port, final String password) {
		this.hostname = hostname;
		this.ipAddress = ipAddress;
		this.port = port;
		this.password = password;
	}

	public ComputerInfos(final ComputerInfos serverInfo) {
		this.hostname = serverInfo.hostname;
		this.ipAddress = serverInfo.ipAddress;
		this.port = serverInfo.port;
		this.password = serverInfo.password;
	}

	public final String getHostname() {
		return hostname;
	}

	public final void setHostname(final String hostname) {
		this.hostname = hostname;
	}

	public final String getIpAddress() {
		return ipAddress;
	}

	public final void setIpAddress(final String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public final int getPort() {
		return port;
	}

	public final void setPort(final int port) {
		this.port = port;
	}

	public final String getPassword() {
		return password;
	}

	public final void setPassword(final String password) {
		this.password = password;
	}

	@Override
	public final String toString() {
		return ProjectUtil.md5(ProjectUtil.SECRECT_KEY) + ":" + hostname + ":"
				+ ipAddress + ":" + port + ":" + password;
	}

}
